<template>
  <div>
    <h1>懒加载</h1>
    <div v-for="i in 7" :key="i" class="box">盒子</div>
    <img v-lazy :src="url" alt="" />
    <img :src="url" alt="" />
  </div>
</template>

<script>
export default {
  name: "lazyload",
  data() {
    return {
      url: "https://img-home.csdnimg.cn/images/20201124032511.png",
    };
  },
  mounted() {},
  methods: {},
};
</script>

<style scoped>
.box {
  width: 200px;
  height: 200px;
  border: 1px solid #000;
  background-color: aquamarine;
}
</style>